import { http } from 'jindai-api'

const url = 'admin/banner'

export const fetchList = (params) => http.get(`${url}s`, { params })

export const fetchView = (id) => http.get(`${url}/${id}`)

export const store = (params) => http.post(url, params)

export const edit = (id, params) => http.put(`${url}/${id}`, params)

export const destory = (id) => http.delete(`${url}/${id}`)

export const online = (id) => http.put(`${url}/${id}/online`)

export const offline = (id) => http.put(`${url}/${id}/offline`)
